<%@page import="com.google.appengine.api.datastore.KeyFactory"%>
<%@page import="cn.edu.hust.sse.software7.class3.entities.EBCategory"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<html>
<head>
<title>Insert title here</title>
<%
	List<EBCategory> categories = (List<EBCategory>) session
			.getAttribute("categories");
%>
</head>
<body>
<div style="background-color: activeborder;">
<%
	if (categories.isEmpty() || null == categories) {
%>
!没有商品目录，请
<a href="/goto?page=addcategoty">添加</a>
!
<%
	} else {
%>
<table style="background-color: silver; width: 100%; border: medium;">
	<tr>		
		<td><b>商品种类名称</b></td>
		<td><b>描述</b></td>
		<td></td>
	</tr>
	<%
		for (EBCategory category : categories) {
	%>
	<tr>
		<td><%=category.getCategoryName()%></td>
		<td><%=category.getCategoryDesc()%></td>
		<td><a
			href="/goto?page=addProd&categoryId=<%=category.getCategoryId()%>">添加商品</a>
		<a
			href="/goto?page=addcategoty&parentCategoryId=<%=category.getCategoryId()%>">添加商品目录</a>
		<a
			href="/category?method=deletecategory&category2Delete=<%=category.getCategoryId()%>">删除</a>
		</td>
	</tr>
	<%
		}
	%>
</table>
<%
	}
%>
</div>
</body>
</html>